﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using PerformanceDude.MSBuildShellExtension.Common;
using System.IO;
using System.Reflection;

namespace CommonTests
{
    [TestFixture]
    public class ConfigurationSettingsTests
    {
        [Test]
        public void Load_DefaultConfigurationSettings_Succeeds()
        {
            Assembly assembly = Assembly.GetExecutingAssembly();
            string testDllFilePath = assembly.Location;
            string defaultConfigurationFilePath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(testDllFilePath), @"..\..\..\Setup\MSBuildShellExtension.config"));

            string configurationFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
                        @"PerformanceDude\MSBuildShellExtension\MSBuildShellExtension.config");

            File.WriteAllLines(configurationFilePath, File.ReadAllLines(defaultConfigurationFilePath));

            ConfigurationSettings configurationSettings = new ConfigurationSettings(true);
        }
    }
}
